include ./make.inc
NODE_PATH=node
WORKSPACE=.
TARGET=$(WORKSPACE)/build/apolloxlua.console.js
TMP=$(WORKSPACE)/build/tmp.js
VERSION=1.0.0.2

LUA=/bin/lua.exe
$(TMP):clean
	@echo "==================apolloxlua console case is build========================"
	@echo "" > $(TMP)
concat:$(TMP)
	@echo "var exports = {};" > $(TMP)
	$(call __definedir__,$(WORKSPACE)/core/,$(TMP));
	$(call __definedir__,$(WORKSPACE)/core/data,$(TMP));
	$(call __definedir__,$(WORKSPACE)/core/componet,$(TMP));
	
	
clean:
	rm -f $(WORKSPACE)/build/*.js
	
page:
	@echo "" > $(TMP)
	$(call __define__,$(WORKSPACE)/core/html/,index.html,$(TMP));
	$(LUA) def.lua $(TMP) $(WORKSPACE)/build/standard_index.html MODE=page  DEBUG=1 
	
codepen:
	@echo "" > $(TMP)
	$(call __define__,$(WORKSPACE)/core/html/,index.html,$(TMP));
	$(LUA) def.lua $(TMP) $(WORKSPACE)/build/codepen_part.html MODE=codepen  DEBUG=0 
view:
	@echo "" > $(TMP)
	$(call __define__,$(WORKSPACE)/core/html/,view.html,$(TMP));
	$(LUA) def.lua $(TMP) $(WORKSPACE)/build/view.html MODE=page  DEBUG=0
	
js:concat
	$(LUA) def.lua $(TMP) $(TMP) SCRIPT=lua  DEBUG=1 PLAT=tool
	java -jar ../lib/compress.jar --compilation_level SIMPLE_OPTIMIZATIONS\
	       	--js=$(TMP) --js_output_file=$(TARGET)
	$(call __definedir__,$(WORKSPACE)/lib/,$(TARGET));
	

mock:clean
	cd mock && make all
	
all:clean js view codepen
	rm -f $(TMP)
	@echo "==================apolloxlua  console case  build done========================"

	
